import java.util.Scanner;

public class Ex4_43{
	public static void main(String[] args){
		Scanner input = new Scanner(System.in);
		System.out.print("Enter the number of second: ");
		int second = input.nextInt();
		for (int i = second; i > 0; i--){
			long startTime = System.currentTimeMillis();
			long endTime;
			do{
				endTime = System.curre ntTimeMillis();
			}while (endTime - startTime <= 1000);
			if (i > 2)
				System.out.printf("%d seconds remaining.\n", i-1);
			else if (i == 2)
				System.out.printf("1 second remaining.\n");	
			else
				System.out.printf("Stopped\n");
		}
	}
}